F1 Layout

Map indicates the layout of the F1 generation resulting from a cross between EC201 and EC103 parents. Column 1 is approximately lengthways facing north.

Map of F1 Trees

“Map of F1 Trees”

Height Diagram

Diagram indicates the areas of leaf collection regarding height. Each Tree had 10 leaves collected, 3 from Low, 4 from Mid and 3 from High. The first leaf sampled was measured twice for replication comparison.

Diagram of leaf collection levels

“Diagram of leaf collection levels”

Import and Arrange Data

“Full.xlsx” contains measurement information from sampling with the Dualex (https://www.force-a.com/en/capteurs-optiques-optical-sensors/dualex-scientific-chlorophyll-meter/), including;

It also contains information about the block position, the leaf height information, and presense or absence of flowering

Sheet “Dup” contains only the samples that were replicated.

# Import Data Measures
Data <-read.xlsx("Full.xlsx", sheetName ="Full")
head(Data)
##   Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 1              4         CG     0      0   0    20       OG      CG    N
## 2              4         CG     0      0   0    20       OG      CG    N
## 3              4         CG     0      0   0    20       OG      CG    N
## 4              4         CG     0      0   0    20       OG      CG    N
## 5              4         CG     0      0   0    20       OG      CG    N
## 6              4         CG     0      0   0    20       OG      CG    N
##   measure Height Flower    Chl  Flav  Anth   NBI
## 1       9      H      Y 28.220 2.418 0.205 11.67
## 2       3      L      Y 27.958 2.298 0.691 12.17
## 3      11      H      Y 33.727 2.458 0.527 13.72
## 4       4      L      Y 25.938 1.758 0.172 14.76
## 5      10      H      Y 36.205 2.283 0.270 15.86
## 6       6      M      Y 34.332 2.115 0.150 16.23
# Import Replicate Data
Dup <-read.xlsx("Full.xlsx", sheetName ="Dup")
head(Dup)
##   Collection.Day group Group.ID Tree.ID Rep. measure Height   Chl  Flav
## 1            2.0    23       60   IN4DV   Y1       1      L 1.916 2.363
## 2            1.5     3        1   IN4BT   Y1       1      L 3.124 2.300
## 3            2.0    17       54   IN4DL   Y2       2      L 3.414 1.826
## 4            1.5    32       28   IN4CP   Y2       2      L 4.097 1.943
## 5            2.0     9       46   IN4DC   Y1       1      L 4.909 1.928
## 6            1.5     5        3   IN4BW   Y1       1      L 4.924 1.848
##    Anth  NBI
## 1 0.174 0.81
## 2 0.191 1.36
## 3 0.112 1.87
## 4 0.051 2.11
## 5 0.103 2.55
## 6 0.165 2.66
#Isolate Crimson Glory Outgroup
CG = Data[c(1:11),]
head(CG)
##   Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 1              4         CG     0      0   0    20       OG      CG    N
## 2              4         CG     0      0   0    20       OG      CG    N
## 3              4         CG     0      0   0    20       OG      CG    N
## 4              4         CG     0      0   0    20       OG      CG    N
## 5              4         CG     0      0   0    20       OG      CG    N
## 6              4         CG     0      0   0    20       OG      CG    N
##   measure Height Flower    Chl  Flav  Anth   NBI
## 1       9      H      Y 28.220 2.418 0.205 11.67
## 2       3      L      Y 27.958 2.298 0.691 12.17
## 3      11      H      Y 33.727 2.458 0.527 13.72
## 4       4      L      Y 25.938 1.758 0.172 14.76
## 5      10      H      Y 36.205 2.283 0.270 15.86
## 6       6      M      Y 34.332 2.115 0.150 16.23
#Isolate East Cape 201 Parent
EC201 = Data[c(12:21),]
head(EC201)
##    Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 12              4      EC201     0      0   0    18       P1   EC201    N
## 13              4      EC201     0      0   0    18       P1   EC201    N
## 14              4      EC201     0      0   0    18       P1   EC201    N
## 15              4      EC201     0      0   0    18       P1   EC201    N
## 16              4      EC201     0      0   0    18       P1   EC201    N
## 17              4      EC201     0      0   0    18       P1   EC201    N
##    measure Height Flower    Chl  Flav  Anth   NBI
## 12       9      H      Y 30.722 2.138 0.156 14.37
## 13       6      M      Y 45.272 1.861 0.075 24.33
## 14      10      H      Y 46.174 1.868 0.052 24.72
## 15       8      M      Y 57.480 1.897 0.037 30.30
## 16       5      M      Y 57.752 1.681 0.125 34.35
## 17       3      L      Y 54.927 1.592 0.061 34.50
#Isolate East Cape 103 Parent
EC103 = Data[c(22:33),]
head(EC103)
##    Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 22              4      EC103     0      0   0    19       P2   EC103    N
## 23              4      EC103     0      0   0    19       P2   EC103    N
## 24              4      EC103     0      0   0    19       P2   EC103    N
## 25              4      EC103     0      0   0    19       P2   EC103    N
## 26              4      EC103     0      0   0    19       P2   EC103    N
## 27              4      EC103     0      0   0    19       P2   EC103    N
##    measure Height Flower    Chl  Flav  Anth   NBI
## 22       8      M      Y 31.471 1.324 0.018 23.77
## 23      11      H      Y 57.349 2.111 0.053 27.17
## 24       4      L      Y 43.949 1.478 0.004 29.73
## 25      12      H      Y 56.779 1.846 0.108 30.75
## 26       9      M      Y 55.916 1.746 0.055 32.03
## 27      10      H      Y 57.809 1.746 0.054 33.11
#Isolate Offspring from the Parental Cross
F1 = Data[c(34:1825),]
head(F1)
##    Collection.Day Allocation Block Column Row group Group.ID Tree.ID Rep.
## 34              1         F1     1      1   1    15        1   IN4BT    N
## 35              1         F1     1      1   1    15        1   IN4BT    N
## 36              1         F1     1      1   1    15        1   IN4BT    N
## 37              1         F1     1      1   1    15        1   IN4BT    N
## 38              1         F1     1      1   1    15        1   IN4BT    N
## 39              1         F1     1      1   1    15        1   IN4BT   Y1
##    measure Height Flower    Chl  Flav  Anth   NBI
## 34       8      M      N  3.268 1.958 0.143  1.67
## 35       2      L      N 23.326 2.581 0.065  9.04
## 36      11      M      N 24.682 2.265 0.112 10.90
## 37       7      M      N 27.068 2.229 0.084 12.14
## 38      14      H      N 27.459 2.135 0.138 12.86
## 39       3      L      N 34.592 2.583 0.048 13.39

Checking Similarity of Replicates

Replicates were taken by measuring a leaf sample of each tree twice, in order to establish consistency and reliability of measurements with the Dualex.

R <-group_by(Data,Rep.)

Replicate Means

#Chlorophyll
RC = mean(R$Chl);RC
## [1] 35.21443
#Nitrogen Index
RN = mean(R$NBI);RN
## [1] 18.34807
#Anthocyanin
RA = mean(R$Anth);RA
## [1] 0.09772877
#Flavanoids
RF = mean(R$Flav);RF
## [1] 1.964405

Replicate Plots

plot<- ggplot(Dup) + aes(x = Rep., y = Chl) + geom_boxplot()+geom_hline(yintercept = RC)
plot2<- ggplot(Dup) + aes(x = Rep., y = NBI ) + geom_boxplot()+geom_hline(yintercept = RN)
plot3<- ggplot(Dup) + aes(x = Rep., y = Anth ) + geom_boxplot()+geom_hline(yintercept = RA)
plot4<- ggplot(Dup) + aes(x = Rep., y = Flav ) + geom_boxplot()+geom_hline(yintercept = RF)

grid.arrange(plot,plot2,plot3,plot4, ncol = 4)

ANOVA of Replicates

#Chlorophyll
mod <-lm(Dup$Chl ~ Dup$Rep.)
anova(mod)
## Analysis of Variance Table
## 
## Response: Dup$Chl
##            Df Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep.    1    218  218.33   1.033 0.3102
## Residuals 314  66366  211.36
#Flavanol
mod2 <-lm(Dup$Flav ~ Dup$Rep.)
anova(mod2)
## Analysis of Variance Table
## 
## Response: Dup$Flav
##            Df  Sum Sq  Mean Sq F value Pr(>F)
## Dup$Rep.    1  0.0521 0.052129  0.6506 0.4205
## Residuals 314 25.1596 0.080126
#Anthocyanin
mod3 <-lm(Dup$Anth ~ Dup$Rep.)
anova(mod3)
## Analysis of Variance Table
## 
## Response: Dup$Anth
##            Df  Sum Sq   Mean Sq F value Pr(>F)
## Dup$Rep.    1 0.00003 0.0000304  0.0151 0.9023
## Residuals 314 0.63303 0.0020160
#Nitrogen
mod4 <-lm(Dup$NBI ~ Dup$Rep.)
anova(mod4)
## Analysis of Variance Table
## 
## Response: Dup$NBI
##            Df  Sum Sq Mean Sq F value Pr(>F)
## Dup$Rep.    1    82.5  82.530   1.115 0.2918
## Residuals 314 23241.0  74.016

The absence of statistically significant results indicates that our replicates are likely to be consistent.

Comparing Allocations

Allocation refers to which group measurements were taken from, i.e. A Parental Tree (EC103, EC201), Outgroup Tree (CG), F1 Cross offspring

AL <-group_by(Data,Allocation)

Measurement Means

#Chlorophyll
AlC = mean(AL$Chl);AlC
## [1] 35.21443
#Nitrogen
AlN = mean(AL$NBI);AlN
## [1] 18.34807
#Flavanoids
AlF = mean(AL$Flav);AlF
## [1] 1.964405
#Anthocyanin
AlA = mean(AL$Anth);AlA
## [1] 0.09772877

Boxplot comparing medians and measurement distributions

plot5<- ggplot(Data) + aes(x = Allocation, y = Chl) + geom_boxplot()+geom_hline(yintercept = AlC)
plot6<- ggplot(Data) + aes(x = Allocation, y = NBI) + geom_boxplot()+geom_hline(yintercept = AlN)
plot7<- ggplot(Data) + aes(x = Allocation, y = Flav) + geom_boxplot()+geom_hline(yintercept = AlF)
plot8<- ggplot(Data) + aes(x = Allocation, y = Anth) + geom_boxplot()+geom_hline(yintercept = AlA)

grid.arrange(plot5,plot6,plot7,plot8, ncol=2)

ANOVAs

#Chlorophyll
mod5 <-lm(Data$Chl ~ Data$Allocation)
anova(mod5)
## Analysis of Variance Table
## 
## Response: Data$Chl
##                   Df Sum Sq Mean Sq F value    Pr(>F)    
## Data$Allocation    3   6742 2247.21  9.9149 1.748e-06 ***
## Residuals       1821 412728  226.65                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Nitrogen
mod6 <-lm(Data$NBI ~ Data$Allocation)
anova(mod5)
## Analysis of Variance Table
## 
## Response: Data$Chl
##                   Df Sum Sq Mean Sq F value    Pr(>F)    
## Data$Allocation    3   6742 2247.21  9.9149 1.748e-06 ***
## Residuals       1821 412728  226.65                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Flavanol
mod7 <-lm(Data$Flav ~ Data$Allocation)
anova(mod7)
## Analysis of Variance Table
## 
## Response: Data$Flav
##                   Df  Sum Sq Mean Sq F value    Pr(>F)    
## Data$Allocation    3   2.713 0.90423  14.755 1.708e-09 ***
## Residuals       1821 111.598 0.06128                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Anthocyanin
mod8 <-lm(Data$Anth ~ Data$Allocation)
anova(mod8)
## Analysis of Variance Table
## 
## Response: Data$Anth
##                   Df Sum Sq  Mean Sq F value    Pr(>F)    
## Data$Allocation    3 0.3040 0.101343  47.474 < 2.2e-16 ***
## Residuals       1821 3.8873 0.002135                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Parental Cross Analysis (F1 Generation)

Investigating measures across the F1 cross population

O <-group_by(F1,Tree.ID)
SO <-summarise(O,count = n(), Chl = mean(Chl,na.rm =T), NBI = mean(NBI, na.rm=T), Anth = mean(Anth, ra.rm = T), Flav = mean(Flav, na.rm = T));SO
## # A tibble: 159 x 6
##    Tree.ID count   Chl   NBI   Anth  Flav
##    <fct>   <int> <dbl> <dbl>  <dbl> <dbl>
##  1 IN4BT      26  34.5  16.2 0.110   2.17
##  2 IN4BV      11  27.5  13.8 0.121   2.01
##  3 IN4BW      11  24.8  12.5 0.127   1.99
##  4 IN4BX      11  37.6  18.4 0.0905  2.05
##  5 IN4BY      10  24.2  12.5 0.110   1.98
##  6 IN4BZ      11  32.0  15.6 0.106   2.09
##  7 IN4C0      11  28.0  13.4 0.139   2.04
##  8 IN4C1      11  30.8  15.1 0.118   2.04
##  9 IN4C2      11  42.6  21.2 0.0878  2.04
## 10 IN4C3      11  25.7  14.1 0.106   1.97
## # ... with 149 more rows

Surface Content of Chlorophyll (µg/cm²)

#Mean
OC <- mean(SO$Chl);OC
## [1] 35.13564
#Individual Tree Measures
plot15<-ggplot(O) + aes(x = Tree.ID, y = Chl, group_by(Tree.ID)) + geom_boxplot() +geom_hline(yintercept = OC)

#Measure Distribution
plot16<-ggplot(O) + aes(x = Chl) + geom_histogram()
grid.arrange(plot15,plot16)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

#ANOVA
ModChl <- lm(O$Chl ~ O$Tree.ID)
anova(ModChl)
## Analysis of Variance Table
## 
## Response: O$Chl
##             Df Sum Sq Mean Sq F value   Pr(>F)   
## O$Tree.ID  158  47130  298.29  1.3395 0.004474 **
## Residuals 1633 363634  222.68                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Index of Epidermal Flavnols

OF <- mean(SO$Flav);OF
## [1] 1.965265
plot17<-ggplot(O) + aes(x = Tree.ID, y = Flav) + geom_boxplot() +geom_hline(yintercept = OF)
plot18 <-ggplot(O) + aes(x = Flav) + geom_histogram()
grid.arrange(plot17,plot18)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ModFlav <- lm(O$Flav ~ O$Tree.ID)
anova(ModFlav)
## Analysis of Variance Table
## 
## Response: O$Flav
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## O$Tree.ID  158 25.118 0.15897  3.0531 < 2.2e-16 ***
## Residuals 1633 85.030 0.05207                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Epidermal Anthocyanin

OA <- mean(SO$Anth);OA
## [1] 0.09699261
plot19<-ggplot(O) + aes(x = Tree.ID, y = Anth) + geom_boxplot() +geom_hline(yintercept = OA)
plot20<-ggplot(O) + aes(x = Anth) + geom_histogram()
grid.arrange(plot19,plot20)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ModAnth <- lm(O$Anth ~ O$Tree.ID)
anova(ModAnth)
## Analysis of Variance Table
## 
## Response: O$Anth
##             Df Sum Sq   Mean Sq F value    Pr(>F)    
## O$Tree.ID  158 0.5253 0.0033247  1.8093 2.001e-08 ***
## Residuals 1633 3.0007 0.0018376                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Nitrogen Balance Index Status

#Mean
ON <- mean(SO$NBI);ON
## [1] 18.27171
plot21<-ggplot(O) + aes(x = Tree.ID, y = NBI) + geom_boxplot() +geom_hline(yintercept = ON)
plot22<-ggplot(O) + aes(x = NBI) + geom_histogram()
grid.arrange(plot21,plot22)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

ModNBI <- lm(O$NBI ~ O$Tree.ID)
anova(ModNBI)
## Analysis of Variance Table
## 
## Response: O$NBI
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## O$Tree.ID  158  16378 103.661  1.5147 8.435e-05 ***
## Residuals 1633 111761  68.439                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Comparing Measures from the 3 height categories

Comparisons of measures between Low, Mid and High locations on trees.

Hgt <- group_by(F1, Height)
SHgt=summarise(Hgt, count = n(), Chl = mean(Chl,na.rm=T), NBI = mean(NBI, na.rm = T), Anth = mean(Anth, na.rm = T), Flav = mean(Flav, na.rm = T))

#Overall means across all heights
#Chlorophyll
HC = mean(SHgt$Chl);HC
## [1] 34.91248
#Nitrogen
HN = mean(SHgt$NBI);HN
## [1] 18.15982
#Anthocyanin
HA = mean(SHgt$Anth);HA
## [1] 0.09770524
#Flavanoids
HF = mean(SHgt$Flav);HF
## [1] 1.96426
#Boxplots visualising height comparisons
plot23<-ggplot(Hgt) + aes(x = Height, y = NBI) + geom_boxplot()+geom_hline(yintercept = HN)
plot24<-ggplot(Hgt) + aes(x = Height, y = Chl) + geom_boxplot()+geom_hline(yintercept = HC)
plot25<-ggplot(Hgt) + aes(x = Height, y = Flav) + geom_boxplot()+geom_hline(yintercept = HF)
plot26<-ggplot(Hgt) + aes(x = Height, y = Anth) + geom_boxplot()+geom_hline(yintercept = HA)
grid.arrange(plot23,plot24,plot25,plot26,ncol=2)

#Visualising Measurement Distributions
plot231<-ggplot(Hgt) + aes(x = Chl) + geom_histogram()
plot241<-ggplot(Hgt) + aes(x = NBI) + geom_histogram()
plot251<-ggplot(Hgt) + aes(x = Flav) + geom_histogram()
plot261<-ggplot(Hgt) + aes(x = Anth) + geom_histogram()
grid.arrange(plot231,plot241,plot251,plot261)
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

#ANOVA
#Chlorophyll
FitH <- lm(Hgt$Chl ~ Hgt$Height)
anova(FitH)
## Analysis of Variance Table
## 
## Response: Hgt$Chl
##              Df Sum Sq Mean Sq F value Pr(>F)
## Hgt$Height    2    853  426.30  1.8605 0.1559
## Residuals  1789 409911  229.13
#Nitrogen
FitH2 <- lm(Hgt$NBI ~ Hgt$Height)
anova(FitH2)
## Analysis of Variance Table
## 
## Response: Hgt$NBI
##              Df Sum Sq Mean Sq F value Pr(>F)
## Hgt$Height    2    100  50.044  0.6992 0.4971
## Residuals  1789 128039  71.570
#Flavanoids
FitH3 <- lm(Hgt$Flav ~ Hgt$Height)
anova(FitH3)
## Analysis of Variance Table
## 
## Response: Hgt$Flav
##              Df  Sum Sq Mean Sq F value    Pr(>F)    
## Hgt$Height    2   0.915 0.45758  7.4943 0.0005739 ***
## Residuals  1789 109.232 0.06106                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Anthocyanin
FitH4 <- lm(Hgt$Anth ~ Hgt$Height)
anova(FitH4)
## Analysis of Variance Table
## 
## Response: Hgt$Anth
##              Df Sum Sq   Mean Sq F value    Pr(>F)    
## Hgt$Height    2 0.0526 0.0262759  13.533 1.468e-06 ***
## Residuals  1789 3.4735 0.0019416                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Correlations Between Measures

Comparing correlations between the 4 dualex measures

cor(Data[c(13:16)])
##             Chl       Flav       Anth        NBI
## Chl   1.0000000 -0.1060143 -0.3038865  0.9468570
## Flav -0.1060143  1.0000000  0.1845141 -0.3865972
## Anth -0.3038865  0.1845141  1.0000000 -0.3204378
## NBI   0.9468570 -0.3865972 -0.3204378  1.0000000
plot9 <-ggplot(F1) + aes(x = Chl, y = Anth) + geom_point()
plot10 <-ggplot(F1) + aes(x = NBI, y = Anth) + geom_point()
plot11<-ggplot(F1) + aes(x = Flav, y = Anth) + geom_point()
plot12<-ggplot(F1) + aes(x = NBI, y = Chl) + geom_point()
plot13<-ggplot(F1) + aes(x = Flav, y = Chl) + geom_point()
plot14<-ggplot(F1) + aes(x = Flav, y = NBI) + geom_point()
grid.arrange(plot9,plot10,plot11,plot12,plot13,plot14)

comp <-lm(Flav ~ Anth, data = F1)
anova(comp)
## Analysis of Variance Table
## 
## Response: Flav
##             Df  Sum Sq Mean Sq F value    Pr(>F)    
## Anth         1   2.897 2.89687  48.348 4.983e-12 ***
## Residuals 1790 107.251 0.05992                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp2 <-lm(NBI ~ Anth, data = F1)
anova(comp2)
## Analysis of Variance Table
## 
## Response: NBI
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## Anth         1  14102 14101.7  221.35 < 2.2e-16 ***
## Residuals 1790 114037    63.7                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp3 <-lm(Flav ~ NBI, data = F1)
anova(comp3)
## Analysis of Variance Table
## 
## Response: Flav
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## NBI          1 14.948 14.9476  281.05 < 2.2e-16 ***
## Residuals 1790 95.200  0.0532                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp4 <-lm(Flav ~ Anth*NBI, data = F1)
anova(comp4)
## Analysis of Variance Table
## 
## Response: Flav
##             Df Sum Sq Mean Sq  F value    Pr(>F)    
## Anth         1  2.897  2.8969  54.5333 2.332e-13 ***
## NBI          1 12.248 12.2485 230.5764 < 2.2e-16 ***
## Anth:NBI     1  0.022  0.0217   0.4084    0.5229    
## Residuals 1788 94.980  0.0531                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp5 <-lm(Anth ~ Flav*NBI, data = F1)
anova(comp5)
## Analysis of Variance Table
## 
## Response: Anth
##             Df  Sum Sq  Mean Sq F value    Pr(>F)    
## Flav         1 0.09273 0.092735  53.966 3.087e-13 ***
## NBI          1 0.30182 0.301822 175.641 < 2.2e-16 ***
## Flav:NBI     1 0.05898 0.058981  34.323 5.544e-09 ***
## Residuals 1788 3.07250 0.001718                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
comp6 <-lm(NBI ~ Flav*Anth, data = F1)
anova(comp6)
## Analysis of Variance Table
## 
## Response: NBI
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## Flav         1  17389 17389.2 311.087 < 2.2e-16 ***
## Anth         1   9736  9736.0 174.175 < 2.2e-16 ***
## Flav:Anth    1   1068  1068.0  19.106 1.307e-05 ***
## Residuals 1788  99946    55.9                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Column Block Effects

Cmn <- group_by(F1, Column)
SCmn <- summarise(Cmn, count =n(),Chl = mean(Chl,na.rm=T), NBI = mean(NBI, ra.nm = T), Anth = mean(Anth, na.rm=T),Flav = mean(Flav,na.rm =T))

CA = mean(SCmn$Anth);CA
## [1] 0.09596523
CC = mean(SCmn$Chl);CC
## [1] 34.87978
CN = mean(SCmn$NBI);CN
## [1] 18.30061
CF = mean(SCmn$Flav);CF
## [1] 1.947604
plot27<-ggplot(F1) + aes(x = Column, y = Anth,group = Column) + geom_boxplot()+geom_hline(yintercept = CA)

plot28<-ggplot(F1) + aes(x = Column, y = Flav,group = Column) + geom_boxplot() +geom_hline(yintercept = CF)

plot29<-ggplot(F1) + aes(x = Column, y = NBI,group = Column) + geom_boxplot() +geom_hline(yintercept = CN)

plot30<-ggplot(F1) + aes(x = Column, y = Chl,group = Column) + geom_boxplot() +geom_hline(yintercept = CC)

grid.arrange(plot27,plot28,plot29,plot30)

Cmn$Column = as.factor(Cmn$Column)

Col <- lm(Cmn$Anth ~ Cmn$Column)
anova(Col)
## Analysis of Variance Table
## 
## Response: Cmn$Anth
##              Df Sum Sq   Mean Sq F value Pr(>F)
## Cmn$Column    3 0.0122 0.0040655  2.0687 0.1024
## Residuals  1788 3.5138 0.0019652
Col2 <- lm(Cmn$Flav ~ Cmn$Column)
anova(Col2)
## Analysis of Variance Table
## 
## Response: Cmn$Flav
##              Df  Sum Sq Mean Sq F value    Pr(>F)    
## Cmn$Column    3   2.305 0.76823  12.737 3.087e-08 ***
## Residuals  1788 107.843 0.06031                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Col3 <- lm(Cmn$NBI ~ Cmn$Column)
anova(Col3)
## Analysis of Variance Table
## 
## Response: Cmn$NBI
##              Df Sum Sq Mean Sq F value   Pr(>F)   
## Cmn$Column    3    821 273.626  3.8427 0.009333 **
## Residuals  1788 127318  71.207                    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Col4 <- lm(Cmn$Chl ~ Cmn$Column)
anova(Col4)
## Analysis of Variance Table
## 
## Response: Cmn$Chl
##              Df Sum Sq Mean Sq F value  Pr(>F)  
## Cmn$Column    3   1586  528.66  2.3101 0.07453 .
## Residuals  1788 409178  228.85                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Row Block Effects

Rw <-group_by(F1, Row)
SRw =summarise(Rw, count = n(), Chl = mean(Chl, na.rm=T),NBI = mean(NBI, na.rm=T), Flav = mean(Flav, na.rm = T), Anth = mean(Anth, na.rm=T))

#Means
#Chlorophyll
RwC = mean(SRw$Chl);RwC
## [1] 34.93729
#Anthocyanin
RwA = mean(SRw$Anth);RwA
## [1] 0.09720837
#Flavanoid
RwF = mean(SRw$Flav);RwF
## [1] 1.965176
#Nitrogen
RwN = mean(SRw$NBI);RwN
## [1] 18.17205
#Comparing Tree Measures
plot31<-ggplot(Rw) + aes(x = Row, y = Chl, group = Row) + geom_boxplot()  +geom_hline(yintercept = RwC);plot31

plot32<-ggplot(Rw) + aes(x = Row, y = Anth, group = Row) + geom_boxplot() +geom_hline(yintercept = RwA);plot32

plot33<-ggplot(Rw) + aes(x = Row, y = Flav,group = Row) + geom_boxplot() +geom_hline(yintercept = RwF);plot33

plot34<-ggplot(Rw) + aes(x = Row, y = NBI, group = Row) + geom_boxplot() +geom_hline(yintercept = RwN);plot34

#ANOVA
#Anthocyanin
Ro <- lm(Rw$Anth ~ Rw$Row)
anova(Ro)
## Analysis of Variance Table
## 
## Response: Rw$Anth
##             Df Sum Sq   Mean Sq F value    Pr(>F)    
## Rw$Row      49 0.2346 0.0047878  2.5339 4.261e-08 ***
## Residuals 1742 3.2914 0.0018895                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Nitrogen
Ro2 <- lm(Rw$NBI ~ Rw$Row)
anova(Ro2)
## Analysis of Variance Table
## 
## Response: Rw$NBI
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## Rw$Row      49   7866 160.527   2.325 8.14e-07 ***
## Residuals 1742 120273  69.043                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Flavanoids
Ro3 <- lm(Rw$Flav ~ Rw$Row)
anova(Ro3)
## Analysis of Variance Table
## 
## Response: Rw$Flav
##             Df  Sum Sq  Mean Sq F value   Pr(>F)    
## Rw$Row      49   8.215 0.167646   2.865 3.11e-10 ***
## Residuals 1742 101.933 0.058515                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#Chlorophyll
Ro4 <- lm(Rw$Chl ~ Rw$Row)
anova(Ro4)
## Analysis of Variance Table
## 
## Response: Rw$Chl
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## Rw$Row      49  21394  436.61  1.9533 0.0001046 ***
## Residuals 1742 389370  223.52                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Block Effects, Combining Row and Columns.

Z = group_by(F1, Tree.ID,Row,Column)
Z1<- summarise(Z, count = n(), Chl = mean(Chl, na.rm=T),NBI = mean(NBI, na.rm=T), Flav = mean(Flav, na.rm = T), Anth = mean(Anth, na.rm=T))

ZChl = Z1[c(2,3,5)] MChl = mean(ZChl\(Chl);MChl ZChl\)Mean = ZChl$Chl-MChl ZChl = ZChl[-c(3)] write.xlsx(as.data.frame(ZChl), file = “Chl.xlsx”, sheetName =“Chl”,col.names = T, row.names = F)

ZNBI = Z1[c(2,3,6)] MNBI = mean(ZNBI\(NBI);MNBI ZNBI\)Mean = ZNBI$NBI-MNBI ZNBI = ZNBI[-c(3)] write.xlsx(as.data.frame(ZNBI), file = “NBI.xlsx”, sheetName =“NBI”,col.names = T, row.names = F)

ZFlav = Z1[c(2,3,7)] MFlav = mean(ZFlav\(Flav);MFlav ZFlav\)Mean = ZFlav$Flav-MFlav ZFlav = ZFlav[-c(3)] write.xlsx(as.data.frame(ZFlav), file = “Flav.xlsx”, sheetName =“Flav”,col.names = T, row.names = F)

ZAnth = Z1[c(2,3,8)] MAnth = mean(ZAnth\(Anth);MAnth ZAnth\)Mean = ZAnth$Anth-MAnth ZAnth = ZAnth[-c(3)] write.xlsx(as.data.frame(ZAnth), file = “Anth.xlsx”, sheetName =“Anth”,col.names = T, row.names = F)

F1$Column = as.factor(F1$Column)

AnthDoc <-read.xlsx("Anth.xlsx", sheetName = "Anth")
heatmaply(AnthDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
ARC <-lm(F1$Anth ~ F1$Row + F1$Column)
anova(ARC)
## Analysis of Variance Table
## 
## Response: F1$Anth
##             Df Sum Sq   Mean Sq F value    Pr(>F)    
## F1$Row      49 0.2346 0.0047878  2.5369 4.088e-08 ***
## F1$Column    3 0.0095 0.0031656  1.6774    0.1699    
## Residuals 1739 3.2819 0.0018873                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ARC2 <- lm(F1$Anth ~ F1$Row*F1$Column)
anova(ARC2)
## Analysis of Variance Table
## 
## Response: F1$Anth
##                    Df Sum Sq   Mean Sq F value    Pr(>F)    
## F1$Row             49 0.2346 0.0047878  2.6055 1.593e-08 ***
## F1$Column           3 0.0095 0.0031656  1.7227   0.16034    
## F1$Row:F1$Column  106 0.2812 0.0026529  1.4437   0.00276 ** 
## Residuals        1633 3.0007 0.0018376                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
ChlDoc<-read.xlsx("Chl.xlsx", sheetName = "Chl")
heatmaply(ChlDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
CRC <-lm(F1$Chl ~ F1$Row + F1$Column)
anova(CRC)
## Analysis of Variance Table
## 
## Response: F1$Chl
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row      49  21394  436.61  1.9606 9.568e-05 ***
## F1$Column    3   2118  706.12  3.1709   0.02344 *  
## Residuals 1739 387252  222.69                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
CRC2 <- lm(F1$Chl ~ F1$Row*F1$Column)
anova(CRC2)
## Analysis of Variance Table
## 
## Response: F1$Chl
##                    Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row             49  21394  436.61  1.9607 9.766e-05 ***
## F1$Column           3   2118  706.12  3.1710   0.02346 *  
## F1$Row:F1$Column  106  23617  222.81  1.0006   0.48183    
## Residuals        1633 363634  222.68                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
NBIDoc<-read.xlsx("NBI.xlsx", sheetName = "NBI")
heatmaply(NBIDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
NRC <-lm(F1$NBI ~ F1$Row + F1$Column)
anova(NRC)
## Analysis of Variance Table
## 
## Response: F1$NBI
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row      49   7866 160.527  2.3364 6.969e-07 ***
## F1$Column    3    789 263.021  3.8281  0.009527 ** 
## Residuals 1739 119484  68.708                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
NRC2 <- lm(F1$NBI ~ F1$Row*F1$Column)
anova(NRC2)
## Analysis of Variance Table
## 
## Response: F1$NBI
##                    Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row             49   7866 160.527  2.3456 6.383e-07 ***
## F1$Column           3    789 263.021  3.8432   0.00934 ** 
## F1$Row:F1$Column  106   7724  72.864  1.0647   0.31303    
## Residuals        1633 111761  68.439                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
FlavDoc<-read.xlsx("Flav.xlsx", sheetName = "Flav")
heatmaply(FlavDoc, xlab = "Column",ylab ="Row", Rowv = FALSE, Colv = FALSE)
FRC <-lm(F1$Flav ~ F1$Row + F1$Column)
anova(FRC)
## Analysis of Variance Table
## 
## Response: F1$Flav
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row      49  8.215 0.16765   2.923 1.283e-10 ***
## F1$Column    3  2.194 0.73147  12.754 3.031e-08 ***
## Residuals 1739 99.738 0.05735                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
FRC2 <- lm(F1$Flav ~ F1$Row*F1$Column)
anova(FRC2)
## Analysis of Variance Table
## 
## Response: F1$Flav
##                    Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row             49  8.215 0.16765  3.2197 1.370e-12 ***
## F1$Column           3  2.194 0.73147 14.0479 4.826e-09 ***
## F1$Row:F1$Column  106 14.709 0.13876  2.6649 4.222e-16 ***
## Residuals        1633 85.030 0.05207                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Block and Height

BHC <-lm(F1$Chl ~ F1$Row+F1$Column+F1$Height)
anova(BHC)
## Analysis of Variance Table
## 
## Response: F1$Chl
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row      49  21394  436.61  1.9621 9.404e-05 ***
## F1$Column    3   2118  706.12  3.1733   0.02337 *  
## F1$Height    2    730  365.17  1.6410   0.19408    
## Residuals 1737 386522  222.52                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
BHF<-lm(F1$Flav ~ F1$Row+F1$Column+F1$Height)
anova(BHF)
## Analysis of Variance Table
## 
## Response: F1$Flav
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row      49  8.215 0.16765  2.9483 8.704e-11 ***
## F1$Column    3  2.194 0.73147 12.8639 2.589e-08 ***
## F1$Height    2  0.969 0.48448  8.5202 0.0002079 ***
## Residuals 1737 98.769 0.05686                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
BHA<-lm(F1$Anth ~ F1$Row+F1$Column+F1$Height)
anova(BHA)
## Analysis of Variance Table
## 
## Response: F1$Anth
##             Df Sum Sq   Mean Sq F value    Pr(>F)    
## F1$Row      49 0.2346 0.0047878  2.5748 2.363e-08 ***
## F1$Column    3 0.0095 0.0031656  1.7024    0.1645    
## F1$Height    2 0.0520 0.0260055 13.9853 9.433e-07 ***
## Residuals 1737 3.2299 0.0018595                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
BHN<-lm(F1$NBI ~ F1$Row+F1$Column+F1$Height)
anova(BHN)
## Analysis of Variance Table
## 
## Response: F1$NBI
##             Df Sum Sq Mean Sq F value    Pr(>F)    
## F1$Row      49   7866 160.527  2.3352 7.084e-07 ***
## F1$Column    3    789 263.021  3.8262  0.009551 ** 
## F1$Height    2     80  39.808  0.5791  0.560512    
## Residuals 1737 119404  68.742                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Compare Parents

Parent <- rbind(EC201,EC103)
t.test(Parent$Chl ~ Parent$Tree.ID)
## 
##  Welch Two Sample t-test
## 
## data:  Parent$Chl by Parent$Tree.ID
## t = -0.003842, df = 17.804, p-value = 0.997
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -7.830954  7.802387
## sample estimates:
## mean in group EC103 mean in group EC201 
##            52.59242            52.60670
P1 <- lm(Parent$Chl ~ Parent$Tree.ID)
anova(P1)
## Analysis of Variance Table
## 
## Response: Parent$Chl
##                Df Sum Sq Mean Sq F value Pr(>F)
## Parent$Tree.ID  1    0.0   0.001       0 0.9969
## Residuals      20 1461.7  73.087
t.test(Parent$Flav ~ Parent$Tree.ID)
## 
##  Welch Two Sample t-test
## 
## data:  Parent$Flav by Parent$Tree.ID
## t = -1.141, df = 19.612, p-value = 0.2676
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.31409194  0.09215861
## sample estimates:
## mean in group EC103 mean in group EC201 
##            1.599833            1.710800
P2 <-lm(Parent$Flav ~ Parent$Tree.ID)
anova(P2)
## Analysis of Variance Table
## 
## Response: Parent$Flav
##                Df  Sum Sq  Mean Sq F value Pr(>F)
## Parent$Tree.ID  1 0.06717 0.067165  1.2892 0.2696
## Residuals      20 1.04195 0.052098
t.test(Parent$NBI ~ Parent$Tree.ID)
## 
##  Welch Two Sample t-test
## 
## data:  Parent$NBI by Parent$Tree.ID
## t = 0.47573, df = 14.7, p-value = 0.6413
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.076667  7.987334
## sample estimates:
## mean in group EC103 mean in group EC201 
##            33.14333            31.68800
P3<- lm(Parent$NBI ~ Parent$Tree.ID)
anova(P3)
## Analysis of Variance Table
## 
## Response: Parent$NBI
##                Df Sum Sq Mean Sq F value Pr(>F)
## Parent$Tree.ID  1  11.55  11.553  0.2455 0.6256
## Residuals      20 941.01  47.050
t.test(Parent$NBI ~ Parent$Tree.ID)
## 
##  Welch Two Sample t-test
## 
## data:  Parent$NBI by Parent$Tree.ID
## t = 0.47573, df = 14.7, p-value = 0.6413
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -5.076667  7.987334
## sample estimates:
## mean in group EC103 mean in group EC201 
##            33.14333            31.68800
P4 <-lm(Parent$NBI ~ Parent$Tree.ID)
anova(P4)
## Analysis of Variance Table
## 
## Response: Parent$NBI
##                Df Sum Sq Mean Sq F value Pr(>F)
## Parent$Tree.ID  1  11.55  11.553  0.2455 0.6256
## Residuals      20 941.01  47.050

Flowering

plot35<- ggplot(F1) + aes(x = Flower, y = Chl) + geom_boxplot()
plot36<- ggplot(F1) + aes(x = Flower, y = NBI) + geom_boxplot()
plot37<- ggplot(F1) + aes(x = Flower, y = Flav) + geom_boxplot()
plot38<- ggplot(F1) + aes(x = Flower, y = Anth) + geom_boxplot()

grid.arrange(plot35,plot36,plot37,plot38)

CF<- lm(F1$Chl ~ F1$Flower)
anova(CF)
## Analysis of Variance Table
## 
## Response: F1$Chl
##             Df Sum Sq Mean Sq F value Pr(>F)
## F1$Flower    1     71  71.075  0.3098 0.5779
## Residuals 1790 410693 229.437
NF<- lm(F1$NBI ~ F1$Flower)
anova(NF)
## Analysis of Variance Table
## 
## Response: F1$NBI
##             Df Sum Sq Mean Sq F value  Pr(>F)  
## F1$Flower    1    196 196.270  2.7459 0.09768 .
## Residuals 1790 127943  71.476                  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
FF<- lm(F1$Flav ~ F1$Flower)
anova(FF)
## Analysis of Variance Table
## 
## Response: F1$Flav
##             Df  Sum Sq Mean Sq F value    Pr(>F)    
## F1$Flower    1   0.677 0.67660  11.063 0.0008983 ***
## Residuals 1790 109.471 0.06116                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
AF<- lm(F1$Anth ~ F1$Flower)
anova(AF)
## Analysis of Variance Table
## 
## Response: F1$Anth
##             Df Sum Sq   Mean Sq F value Pr(>F)
## F1$Flower    1 0.0002 0.0001517   0.077 0.7814
## Residuals 1790 3.5259 0.0019698